import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: 'id',
    align: "center",
    sorter: true,
    dataIndex: 'id'
  },
  {
    title: '创建日期',
    align:"center",
    dataIndex: 'createTime',
    resizable:true
  },
  {
    title: '发票号码',
    align:"center",
    sorter: true,
    resizable:true,
    dataIndex: 'invoiceNumber'
  },
  {
    title: '数电票号码',
    align:"center",
    sorter: true,
    dataIndex: 'electronicInvoiceNumber',
    resizable:true
  },
  {
    title: '销方名称',
    align:"center",
    sorter: true,
    dataIndex: 'sellerName',
    resizable:true
  },
  {
    title: '购买方名称',
    align:"center",
    sorter: true,
    dataIndex: 'buyerName',
    resizable:true
  },
  {
    title: '开票日期',
    align:"center",
    sorter: true,
    dataIndex: 'issueDate',
    resizable:true
  },
  {
    title: '金额',
    align:"center",
    sorter: true,
    dataIndex: 'amount',
    resizable:true
  },
  {
    title: '税额',
    align:"center",
    sorter: true,
    dataIndex: 'tax'
  },
  {
    title: '价税合计',
    align:"center",
    sorter: true,
    dataIndex: 'totalPriceWithTax',
    resizable:true
  },
  {
    title: '发票种类',
    align:"center",
    sorter: true,
    dataIndex: 'invoiceSource',
    resizable:true
  },
  {
    title: '发票票种',
    align:"center",
    sorter: true,
    resizable:true,
    dataIndex: 'invoiceType'
  },
  {
    title: '发票状态',
    align:"center",
    sorter: true,
    dataIndex: 'invoiceStatus',
    resizable:true
  },
  {
    title: '开票人',
    align:"center",
    dataIndex: 'issuerName',
    resizable:true
  },
  {
    edit:true,
    editRule: async (text) => {
      if (!text) {
        return '不能输入空值';
      }
      return '';
    },
    title: '报销人',
    align:"center",
    sorter: true,
    resizable:true,
    dataIndex: 'reimbursement'
  },
  {
    title: '报销状态',
    align:"center",
    dataIndex: 'status_dictText',
    resizable:true
  },
];

// 高级查询数据
export const superQuerySchema = {
  electronicInvoiceNumber: {title: '数电票号码',order: 2,view: 'text', type: 'string',},
  sellerName: {title: '销方名称',order: 4,view: 'text', type: 'string',},
  buyerName: {title: '购买方名称',order: 6,view: 'text', type: 'string',},
  issueDate: {title: '开票日期',order: 7,view: 'datetime', type: 'string',},
  amount: {title: '金额',order: 8,view: 'number', type: 'number',},
  tax: {title: '税额',order: 9,view: 'number', type: 'number',},
  totalPriceWithTax: {title: '价税合计',order: 10,view: 'number', type: 'number',},
  invoiceSource: {title: '发票来源',order: 11,view: 'text', type: 'string',},
  invoiceType: {title: '发票状态',order: 12,view: 'text', type: 'string',},
  issuerName: {title: '开票人',order: 15,view: 'text', type: 'string',},
  status: {title: '报销状态',order: 17,view: 'text', type: 'string',},
};
